package com.jjx.trainingapi.common;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 通用数据库基类
 * @author LoveHuahua
 * @date 2022年05月07日 23:14
 * @description believe in yourself
 */
@Data
public class BaseColumns {
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 创建人
     */
    @TableField(value = "create_by",fill = FieldFill.INSERT,select = false)
    @JsonIgnore(value = true)

    private Integer createBy;

    /**
     * 最后更新人
     */
    @TableField(value = "last_update_by",fill = FieldFill.INSERT_UPDATE,select = false)
    @JsonIgnore(value = true)
    private Integer lastUpdateBy;

    /**
     * 创建时间
     */
    @TableField(value = "create_time",fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 最后更新时间
     */
    @TableField(value = "last_update_time",fill = FieldFill.INSERT_UPDATE,select = false)
    @JsonIgnore(value = true)
    private LocalDateTime lastUpdateTime;

    /**
     * 逻辑删除
     */
    @TableField(value = "remove_flag",select = false)
    @TableLogic
    @JsonIgnore(value = true)
    private Integer removeFlag;
}
